import request from '@/utils/bosssoft-request'

export function fetchList(userQuery) {
  console.log(userQuery)
  return request({
    url: 'http://localhost:8080/api/v1/permission/user/selectUserInfo',
    method: 'post',
    headers: {
      'Content-Type': 'application/json'
    },
    data: userQuery
  })
}

export function fetchArticle(id) {
  return request({
    url: '/vue-element-admin/userInfo/detail',
    method: 'get',
    params: { id }
  })
}

export function createArticle(data) {
  return request({
    url: 'http://localhost:8080/api/v1/permission/user/addUserInfo',
    method: 'post',
    data
  })
}

export function updateArticle(data) {
  return request({
    url: 'http://localhost:8080/api/v1/permission/user/modifyUserInfo',
    method: 'post',
    data
  })
}

export function updateStatus(data) {
  return request({
    url: 'http://localhost:8080/api/v1/permission/user/modifyUserStatus',
    method: 'post',
    data
  })
}

export function deleteUser(data) {
  return request({
    url: 'http://localhost:8080/api/v1/permission/user/deleteUserById',
    method: 'post',
    data
  })
}

export function deleteUsers(data) {
  return request({
    url: 'http://localhost:8080/api/v1/permission/user/deleteUsersByIds',
    method: 'post',
    data
  })
}

export function startUsers(data) {
  return request({
    url: 'http://localhost:8080/api/v1/permission/user/startUsers',
    method: 'post',
    data
  })
}

export function shutUsers(data) {
  return request({
    url: 'http://localhost:8080/api/v1/permission/user/shutUsers',
    method: 'post',
    data
  })
}

export function selectRoleList() {
  return request({
    url: 'http://localhost:8080/api/v1/permission/user/selectRoleList',
    method: 'post'
  })
}

export function allocateCharacter(data) {
  console.log(data)
  return request({
    url: 'http://localhost:8080/api/v1/permission/user/allocateCharacter',
    method: 'post',
    data
  })
}

export function getTree() {
  return request({
    url: 'http://localhost:8080/api/v1/permission/user/getTree',
    method: 'get'
  })
}

// export function fetchList(query) {
//   console.log(query)
//   return request({
//     url: '/vue-element-admin/user/list',
//     method: 'get',
//     params: query
//   })
// }

// export function createArticle(data) {
//   return request({
//     url: '/vue-element-admin/user/create',
//     method: 'post',
//     data
//   })
// }

// export function updateArticle(data) {
//   return request({
//     url: '/vue-element-admin/user/update',
//     method: 'post',
//     data
//   })
// }
